.. highlightlang:: us .. index:: @f{xyinterpol} .. _@f{xyinterpol}: @f{xyinterpol} ============== .. us.tag @f{xyinterpol} NOTREADYENGLISH fieldfunction New5150 Displays the interpolated y-coordinate for a given x-coordinate or the x-coordinate for a given y-coordinate of a 1D or 2D dataset. .. function:: @f{xyinterpol(datasetname, Value)} @f{xyinterpol(dataset, Value, format)} @f{xyinterpol(dataset, Value, format, i_intersect)} @f{xyinterpol(dataset, Value, format, i_intersect, default_return)} .. us.params **Parameters** **Parameter** .. uparam:: dataset Specifies the 1D or 2D dataset. Can be one of the following values: .. list-table:: :header-rows: 1 * - Value - Description * - Dataset name - Is the name of the dataset, e.g. Data1. * - Index of the dataset - Is the index. The first dataset in the layer has the index 1. * - Layer name:Index of the dataset - If the layer name is given, the field function can be in a text object owned by a differen layer, e.g. Diagram1:1. .. uparam:: Value Is the value of a coordinate. The value can start with ``x=`` or ``y=``. Default is ``x=``. .. uparam:: format Specifies the number format. The default format is %g. Example: %.3lf will print the values with 3 decimal places. For a complete description see :ref:`printf`. In field functions commas are not allowed inside the format string. .. uparam:: i_intersect If more than one intersection exists with the dataset, the index of the intersection can be specified. Negative values count from the end. Default value is 1. .. uparam:: default_return Sets the default return value, if the dataset has no intersection or the dataset is not found. Default value is ``----``. .. us.example **Example** ``@f{xyinterpol(Data1, y=54.21)}`` ``Power at 2100 rpm: @f{xyinterpol(Data1, x=2100, %.2lf kW)}`` ``Power at 2100 rpm: @f{xyinterpol(Diagram1:1, 2100, %.2lf kW, 1)}`` **Output**: ``2100`` ``Power at 2100 rpm: 54.21 kW`` ``Power at 2100 rpm: 54.21 kW`` **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2022.4 - The 'x=' now works even if x-axis is not time based. The "y=" request also works. * - R2012.13 - Error in parameter *i_intersect* fixed. * - 5.15.0 - New. .. seealso:: :ref:`overview-field-functions`, :ref:`editupdate-fields`, :ref:`diagraminsert-field-function`, :ref:`DT_Format`, :ref:`printf`, :ref:`@f{xyvalue}` :sub:`id-483697`